
/*

___________________________________________________________________________
Firm performance analysis includes the following items

_________
Main text

Figure 7: 10-year survival rates of new incorporated businesses by individual and parental income and by parental entrepreneurship

Figure 8: Firm-level outcomes by individual income and parental entrepreneurship

Figure 9: Firm-level outcomes by parental income and parental entrepreneurship

_________
Appendix

Table A3: Firm-level outcomes: Comparing the relative importance of various predictors using dominance analysis

Figure A10: Survival rates of new incorporated businesses by individual and parental income and by parental entrepreneurship: Full dynamics

Figure A11: Survival rates measured by bankruptcies of new incorporated businesses by individual and parental income and by parental entrepreneurship: Full dynamics

Figure A12: Firm-level outcomes by individual income and parental entrepreneurship within the top decile of individual income

Figure A13: Firm-level outcomes by individual income and parental entrepreneurship: conditional on survival until t+10

Figure A14: Firm-level outcomes by parental income and parental entrepreneurship: conditional on survival until t+10

*/









/*
________________________________________________________________________________
Main text
*/

/*
Figure 7: 10-year survival rates of new incorporated businesses by individual and parental income and by parental entrepreneurship
*/

use "$output\05_firmperformance\fig7_figA10_figA11", clear
keep if spec=="taxfile"
rename survival_newie_* *
foreach var of varlist own1_peyes-prnt10_peno {
	replace `var' = `var' * 100
}
keep if age==10

* Own rank, parent entrepreneur
preserve
keep age own*
keep age *_peyes
rename *_peyes *
foreach var of varlist own1 - own10 {
	rename `var' peyes_`var'
}
reshape long peyes_own, i(age) j(rank)
drop age
save "$output\05_firmperformance\temp_peyes_own", replace
restore
* Own rank, parent not entrepreneur
preserve
keep age own*
keep age *_peno
rename *_peno *
foreach var of varlist own1 - own10 {
	rename `var' peno_`var'
}
reshape long peno_own, i(age) j(rank)
drop age
save "$output\05_firmperformance\temp_peno_own", replace
restore
* Parent rank, parent entrepreneur
preserve
keep age prnt*
keep age *_peyes
rename *_peyes *
foreach var of varlist prnt1 - prnt10 {
	rename `var' peyes_`var'
}
reshape long peyes_prnt, i(age) j(rank)
drop age
save "$output\05_firmperformance\temp_peyes_prnt", replace
restore
* Parent rank, parent not entrepreneur
preserve
keep age prnt*
keep age *_peno
rename *_peno *
foreach var of varlist prnt1 - prnt10 {
	rename `var' peno_`var'
}
reshape long peno_prnt, i(age) j(rank)
drop age
save "$output\05_firmperformance\temp_peno_prnt", replace
restore

* Form this long data
use "$output\05_firmperformance\temp_peyes_own", clear
merge 1:1 rank using "$output\05_firmperformance\temp_peno_own"
drop _merge
merge 1:1 rank using "$output\05_firmperformance\temp_peyes_prnt"
drop _merge
merge 1:1 rank using "$output\05_firmperformance\temp_peno_prnt"
drop _merge
erase "$output\05_firmperformance\temp_peyes_own.dta"
erase "$output\05_firmperformance\temp_peno_own.dta"
erase "$output\05_firmperformance\temp_peyes_prnt.dta"
erase "$output\05_firmperformance\temp_peno_prnt.dta"

* The bar charts
graph bar peyes_own peno_own, over(rank) graphr(c(white)) scheme(s2mono) ysc(range(0 100)) ylabel(0(20)100, angle(0)) title("{it:Firm survival by individual rank}", size(medsmall)) ytitle("Share filing taxes at {it:t+10} (%)", size(medsmall)) note("Individual income decile rank", size(medsmall) pos(6)) legend(ring(0) bplace(nwest) symy(6) symx(4) order(1 "Parent entrepreneur: Yes" 2 "Parent entrepreneur: No") region(style(none)) cols(1) rowg(0.5)) name(t, replace)
graph bar peyes_prnt peno_prnt, over(rank) graphr(c(white)) scheme(s2mono) ysc(range(0 100)) ylabel(0(20)100, angle(0)) title("{it:Firm survival by parental rank}", size(medsmall)) ytitle("Share filing taxes at {it:t+10} (%)", size(medsmall)) note("Parental income decile rank", size(medsmall) pos(6)) legend(ring(0) bplace(nwest) symy(6) symx(4) order(1 "Parent entrepreneur: Yes" 2 "Parent entrepreneur: No") region(style(none)) cols(1) rowg(0.5)) name(b, replace)

gr combine t b, graphr(c(white)) col(1) ysize(7) name(fig7, replace)
gr drop t b
graph export "$figs\fig7.eps", as(eps) preview(off) replace

/*
Figure 8: Firm-level outcomes by individual income and parental entrepreneurship
*/

use "$output\05_firmperformance\fig8", clear
drop decile
gen dile_l=_n-0.05
gen dile_r=_n+0.05
gen dile_ll=_n-0.2
gen dile_rr=_n+0.2

foreach x in ttl_sales ttl_empl ttl_stfc ttl_va ttl_prod rd_ever {
	rename `x'_peyes peyes_mean_`x'
	rename `x'_peyes_95lo peyes_95lo_`x'
	rename `x'_peyes_95up peyes_95up_`x'
	rename `x'_peno peno_mean_`x'
	rename `x'_peno_95lo peno_95lo_`x'
	rename `x'_peno_95up peno_95up_`x'
}

*********************************

/*
Sales (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_sales dile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_sales dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_sales peyes_95up_ttl_sales dile_l, col(maroon%25) || rcap peno_95lo_ttl_sales peno_95up_ttl_sales dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel A: Log sales}", size(medsmall)) ytitle("") ysc(range(13 15)) ylabel(13(0.5)15,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(sales, replace)

*********************************

/*
Number of employees (cumulative full-time equivalent from t to t+10)
*/

twoway scatter peyes_mean_ttl_empl dile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_empl dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_empl peyes_95up_ttl_empl dile_l, col(maroon%25) || rcap peno_95lo_ttl_empl peno_95up_ttl_empl dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel B: Log number of employees}", size(medsmall)) ytitle("") ysc(range(1.5 3.5)) ylabel(1.5(0.5)3.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(empl, replace)

*********************************

/*
Staff costs (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_stfc dile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_stfc dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_stfc peyes_95up_ttl_stfc dile_l, col(maroon%25) || rcap peno_95lo_ttl_stfc peno_95up_ttl_stfc dile_r, col(maroon%25) || , graphr(c(white)) scheme(s2mono) title("{it:Panel C: Log staff costs}", size(medsmall)) ytitle("") ysc(range(10.5 13.5)) ylabel(10.5(0.5)13.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(stfc, replace)

*********************************

/*
Value added (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_va dile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_va dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_va peyes_95up_ttl_va dile_l, col(maroon%25) || rcap peno_95lo_ttl_va peno_95up_ttl_va dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel D: Log value added}", size(medsmall)) ytitle("") ysc(range(10 13.5)) ylabel(10(0.5)13.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(va, replace)

*********************************

/*
Productivity, value-added / employees (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_prod dile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_prod dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_prod peyes_95up_ttl_prod dile_l, col(maroon%25) || rcap peno_95lo_ttl_prod peno_95up_ttl_prod dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) ytitle("") title("{it:Panel E: Log productivity}", size(medsmall)) ysc(range(9.5 12.5)) ylabel(9.5(0.5)12.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(prod, replace)

*********************************

/*
Share with any R&D over t and t+10
*/

twoway scatter peyes_mean_rd_ever dile_l, mc(maroon) msymbol(s) || scatter peno_mean_rd_ever dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_rd_ever peyes_95up_rd_ever dile_l, col(maroon%25) || rcap peno_95lo_rd_ever peno_95up_rd_ever dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) ytitle("") title("{it:Panel F: Share any R&D}", size(medsmall)) ysc(range(0.2 0.6)) ylabel(0.2(0.1)0.6,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(order(1 "Parent entrepreneur: Yes" 2 "Parent entrepreneur: No") region(style(none)) cols(1) rowg(0.05) size(small)) name(rd, replace)

*********************************

/*
Combine
*/

gr combine sales empl stfc va prod rd, graphr(c(white)) col(3) ysize(3) title("", size(small) color(black) nobox) note("Individual income decile rank", pos(6) size(small)) name(fig8, replace)
gr drop sales empl stfc va prod rd
graph export "$figs\fig8.eps", as(eps) preview(off) replace

/*
Figure 9: Firm-level outcomes by parental income and parental entrepreneurship
*/

use "$output\05_firmperformance\fig9", clear
drop decile
gen dile_l=_n-0.05
gen dile_r=_n+0.05
gen dile_ll=_n-0.2
gen dile_rr=_n+0.2

foreach x in ttl_sales ttl_empl ttl_stfc ttl_va ttl_prod rd_ever {
	rename `x'_peyes peyes_mean_`x'
	rename `x'_peyes_95lo peyes_95lo_`x'
	rename `x'_peyes_95up peyes_95up_`x'
	rename `x'_peno peno_mean_`x'
	rename `x'_peno_95lo peno_95lo_`x'
	rename `x'_peno_95up peno_95up_`x'
}

*********************************

/*
Sales (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_sales dile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_sales dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_sales peyes_95up_ttl_sales dile_l, col(maroon%25) || rcap peno_95lo_ttl_sales peno_95up_ttl_sales dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel A: Log sales}", size(medsmall)) ytitle("") ysc(range(13 15)) ylabel(13(0.5)15,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(sales, replace)

*********************************

/*
Number of employees (cumulative full-time equivalent from t to t+10)
*/

twoway scatter peyes_mean_ttl_empl dile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_empl dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_empl peyes_95up_ttl_empl dile_l, col(maroon%25) || rcap peno_95lo_ttl_empl peno_95up_ttl_empl dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel B: Log number of employees}", size(medsmall)) ytitle("") ysc(range(1.5 3.5)) ylabel(1.5(0.5)3.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(empl, replace)

*********************************

/*
Staff costs (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_stfc dile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_stfc dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_stfc peyes_95up_ttl_stfc dile_l, col(maroon%25) || rcap peno_95lo_ttl_stfc peno_95up_ttl_stfc dile_r, col(maroon%25) || , graphr(c(white)) scheme(s2mono) title("{it:Panel C: Log staff costs}", size(medsmall)) ytitle("") ysc(range(10.5 13.5)) ylabel(10.5(0.5)13.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(stfc, replace)

*********************************

/*
Value added (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_va dile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_va dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_va peyes_95up_ttl_va dile_l, col(maroon%25) || rcap peno_95lo_ttl_va peno_95up_ttl_va dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel D: Log value added}", size(medsmall)) ytitle("") ysc(range(10 13.5)) ylabel(10(0.5)13.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(va, replace)

*********************************

/*
Productivity, value-added / employees (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_prod dile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_prod dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_prod peyes_95up_ttl_prod dile_l, col(maroon%25) || rcap peno_95lo_ttl_prod peno_95up_ttl_prod dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) ytitle("") title("{it:Panel E: Log productivity}", size(medsmall)) ysc(range(9.5 12.5)) ylabel(9.5(0.5)12.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(prod, replace)

*********************************

/*
Share with any R&D over t and t+10
*/

twoway scatter peyes_mean_rd_ever dile_l, mc(maroon) msymbol(s) || scatter peno_mean_rd_ever dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_rd_ever peyes_95up_rd_ever dile_l, col(maroon%25) || rcap peno_95lo_rd_ever peno_95up_rd_ever dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) ytitle("") title("{it:Panel F: Share any R&D}", size(medsmall)) ysc(range(0.2 0.6)) ylabel(0.2(0.1)0.6,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(order(1 "Parent entrepreneur: Yes" 2 "Parent entrepreneur: No") region(style(none)) cols(1) rowg(0.05) size(small)) name(rd, replace)

*********************************

/*
Combine
*/

gr combine sales empl stfc va prod rd, graphr(c(white)) col(3) ysize(3) title("", size(small) color(black) nobox) note("Parental income decile rank", pos(6) size(small)) name(fig9, replace)
gr drop sales empl stfc va prod rd
graph export "$figs\fig9.eps", as(eps) preview(off) replace









/*
________________________________________________________________________________
Appendix
*/

/*
Figure A10: Survival rates of new incorporated businesses by individual and parental income and by parental entrepreneurship: Full dynamics
*/

use "$output\05_firmperformance\fig7_figA10_figA11", clear
keep if spec=="taxfile"

rename survival_newie_* *
foreach var of varlist own1_peyes-prnt10_peno {
	replace `var' = `var' * 100
}
set obs 11
replace age=0 if _n==11
sort age
foreach var of varlist own1_peyes-prnt10_peno {
	replace `var' = 100 if age==0
}

twoway line own1_peyes age, lp(solid) lc(gs14) || line own2_peyes age, lp(dash) lc(gs14) || line own3_peyes age, lp(dash) lc(gs13) || line own4_peyes age, lp(dash) lc(gs11) || line own5_peyes age, lp(dash) lc(gs9) || line own6_peyes age, lp(dash) lc(gs7) || line own7_peyes age, lp(dash) lc(gs5) || line own8_peyes age, lp(dash) lc(gs3) || line own9_peyes age, lp(dash) lc(gs1) || line own10_peyes age, lp(solid) lc(gs1) || , graphr(c(white)) scheme(s2mono) ytitle("", size(medium)) ytitle(, color(black)) title("{it:Panel A: By individual rank, Parent entrepreneur: Yes}", size(medium) color(black) nobox) xtitle("", size(medium)) xtitle(, color(black)) legend(ring(0) bplace(swest) order(10 "Top decile" 1 "Bottom decile" 5 "Deciles 2-9") region(style(none)) cols(1) rowg(0.5)) text(58.5 1.9 "Personal distribution {it:t-1}:") xsc(range(0 10)) xlabel(0(1)10) ysc(range(33 100)) ylabel(40(20)100, angle(0)) name(byownpeyes, replace)

twoway line prnt1_peyes age, lp(solid) lc(gs14) || line prnt2_peyes age, lp(dash) lc(gs14) || line prnt3_peyes age, lp(dash) lc(gs13) || line prnt4_peyes age, lp(dash) lc(gs11) || line prnt5_peyes age, lp(dash) lc(gs9) || line prnt6_peyes age, lp(dash) lc(gs7) || line prnt7_peyes age, lp(dash) lc(gs5) || line prnt8_peyes age, lp(dash) lc(gs3) || line prnt9_peyes age, lp(dash) lc(gs1) || line prnt10_peyes age, lp(solid) lc(gs1) || , graphr(c(white)) scheme(s2mono) ytitle("", size(medium)) ytitle(, color(black)) title("{it:Panel B: By parental rank, Parent entrepreneur: Yes}", size(medium) color(black) nobox) xtitle("", size(medium)) xtitle(, color(black)) legend(ring(0) bplace(swest) order(10 "Top decile" 1 "Bottom decile" 5 "Deciles 2-9") region(style(none)) cols(1) rowg(0.5)) text(58.5 1.62 "Parental distribution:") xsc(range(0 10)) xlabel(0(1)10) ysc(range(33 100)) ylabel(40(20)100, angle(0)) name(byprntpeyes, replace)

twoway line own1_peno age, lp(solid) lc(gs14) || line own2_peno age, lp(dash) lc(gs14) || line own3_peno age, lp(dash) lc(gs13) || line own4_peno age, lp(dash) lc(gs11) || line own5_peno age, lp(dash) lc(gs9) || line own6_peno age, lp(dash) lc(gs7) || line own7_peno age, lp(dash) lc(gs5) || line own8_peno age, lp(dash) lc(gs3) || line own9_peno age, lp(dash) lc(gs1) || line own10_peno age, lp(solid) lc(gs1) || , graphr(c(white)) scheme(s2mono) ytitle("", size(medium)) ytitle(, color(black)) title("{it:Panel C: By individual rank, Parent entrepreneur: No}", size(medium) color(black) nobox) xtitle("", size(medium)) xtitle(, color(black)) legend(ring(0) bplace(swest) order(10 "Top decile" 1 "Bottom decile" 5 "Deciles 2-9") region(style(none)) cols(1) rowg(0.5)) text(58.5 1.9 "Personal distribution {it:t-1}:") xsc(range(0 10)) xlabel(0(1)10) ysc(range(33 100)) ylabel(40(20)100, angle(0)) name(byownpeno, replace)

twoway line prnt1_peno age, lp(solid) lc(gs14) || line prnt2_peno age, lp(dash) lc(gs14) || line prnt3_peno age, lp(dash) lc(gs13) || line prnt4_peno age, lp(dash) lc(gs11) || line prnt5_peno age, lp(dash) lc(gs9) || line prnt6_peno age, lp(dash) lc(gs7) || line prnt7_peno age, lp(dash) lc(gs5) || line prnt8_peno age, lp(dash) lc(gs3) || line prnt9_peno age, lp(dash) lc(gs1) || line prnt10_peno age, lp(solid) lc(gs1) || , graphr(c(white)) scheme(s2mono) ytitle("", size(medium)) ytitle(, color(black)) title("{it:Panel D: By parental rank, Parent entrepreneur: No}", size(medium) color(black) nobox) xtitle("", size(medium)) xtitle(, color(black)) legend(ring(0) bplace(swest) order(10 "Top decile" 1 "Bottom decile" 5 "Deciles 2-9") region(style(none)) cols(1) rowg(0.5)) text(58.5 1.62 "Parental distribution:") xsc(range(0 10)) xlabel(0(1)10) ysc(range(33 100)) ylabel(40(20)100, angle(0)) name(byprntpeno, replace)

* Combine

gr combine byownpeyes byprntpeyes byownpeno byprntpeno, graphr(c(white)) col(2) ysize(3) title("Share of firms filing taxes (%)", pos(9) orientation(vertical) size(small)) note("Firm age in years", pos(6) size(small)) name(figA10, replace)
gr drop byownpeyes byprntpeyes byownpeno byprntpeno
graph export "$figs\figA10.eps", as(eps) preview(off) replace

/*
Figure A11: Survival rates measured by bankruptcies of new incorporated businesses by individual and parental income and by parental entrepreneurship: Full dynamics
*/

use "$output\05_firmperformance\fig7_figA10_figA11", clear
keep if spec=="bankrupt"

rename survival_newie_* *
foreach var of varlist own1_peyes-prnt10_peno {
	replace `var' = `var' * 100
}
set obs 11
replace age=0 if _n==11
sort age
foreach var of varlist own1_peyes-prnt10_peno {
	replace `var' = 100 if age==0
}

twoway line own1_peyes age, lp(solid) lc(gs14) || line own2_peyes age, lp(dash) lc(gs14) || line own3_peyes age, lp(dash) lc(gs13) || line own4_peyes age, lp(dash) lc(gs11) || line own5_peyes age, lp(dash) lc(gs9) || line own6_peyes age, lp(dash) lc(gs7) || line own7_peyes age, lp(dash) lc(gs5) || line own8_peyes age, lp(dash) lc(gs3) || line own9_peyes age, lp(dash) lc(gs1) || line own10_peyes age, lp(solid) lc(gs1) || , graphr(c(white)) scheme(s2mono) ytitle("", size(medium)) ytitle(, color(black)) title("{it:Panel A: By individual rank, Parent entrepreneur: Yes}", size(medium) color(black) nobox) xtitle("", size(medium)) xtitle(, color(black)) legend(ring(0) bplace(swest) order(10 "Top decile" 1 "Bottom decile" 5 "Deciles 2-9") region(style(none)) cols(1) rowg(0.5)) text(91 1.9 "Personal distribution {it:t-1}:") xsc(range(0 10)) xlabel(0(1)10) ysc(range(85 100)) ylabel(85(5)100, angle(0)) name(byownpeyes, replace)

twoway line prnt1_peyes age, lp(solid) lc(gs14) || line prnt2_peyes age, lp(dash) lc(gs14) || line prnt3_peyes age, lp(dash) lc(gs13) || line prnt4_peyes age, lp(dash) lc(gs11) || line prnt5_peyes age, lp(dash) lc(gs9) || line prnt6_peyes age, lp(dash) lc(gs7) || line prnt7_peyes age, lp(dash) lc(gs5) || line prnt8_peyes age, lp(dash) lc(gs3) || line prnt9_peyes age, lp(dash) lc(gs1) || line prnt10_peyes age, lp(solid) lc(gs1) || , graphr(c(white)) scheme(s2mono) ytitle("", size(medium)) ytitle(, color(black)) title("{it:Panel B: By parental rank, Parent entrepreneur: Yes}", size(medium) color(black) nobox) xtitle("", size(medium)) xtitle(, color(black)) legend(ring(0) bplace(swest) order(10 "Top decile" 1 "Bottom decile" 5 "Deciles 2-9") region(style(none)) cols(1) rowg(0.5)) text(91 1.62 "Parental distribution:") xsc(range(0 10)) xlabel(0(1)10) ysc(range(85 100)) ylabel(85(5)100, angle(0)) name(byprntpeyes, replace)

twoway line own1_peno age, lp(solid) lc(gs14) || line own2_peno age, lp(dash) lc(gs14) || line own3_peno age, lp(dash) lc(gs13) || line own4_peno age, lp(dash) lc(gs11) || line own5_peno age, lp(dash) lc(gs9) || line own6_peno age, lp(dash) lc(gs7) || line own7_peno age, lp(dash) lc(gs5) || line own8_peno age, lp(dash) lc(gs3) || line own9_peno age, lp(dash) lc(gs1) || line own10_peno age, lp(solid) lc(gs1) || , graphr(c(white)) scheme(s2mono) ytitle("", size(medium)) ytitle(, color(black)) title("{it:Panel C: By individual rank, Parent entrepreneur: No}", size(medium) color(black) nobox) xtitle("", size(medium)) xtitle(, color(black)) legend(ring(0) bplace(swest) order(10 "Top decile" 1 "Bottom decile" 5 "Deciles 2-9") region(style(none)) cols(1) rowg(0.5)) text(91 1.9 "Personal distribution {it:t-1}:") xsc(range(0 10)) xlabel(0(1)10) ysc(range(85 100)) ylabel(85(5)100, angle(0)) name(byownpeno, replace)

twoway line prnt1_peno age, lp(solid) lc(gs14) || line prnt2_peno age, lp(dash) lc(gs14) || line prnt3_peno age, lp(dash) lc(gs13) || line prnt4_peno age, lp(dash) lc(gs11) || line prnt5_peno age, lp(dash) lc(gs9) || line prnt6_peno age, lp(dash) lc(gs7) || line prnt7_peno age, lp(dash) lc(gs5) || line prnt8_peno age, lp(dash) lc(gs3) || line prnt9_peno age, lp(dash) lc(gs1) || line prnt10_peno age, lp(solid) lc(gs1) || , graphr(c(white)) scheme(s2mono) ytitle("", size(medium)) ytitle(, color(black)) title("{it:Panel D: By parental rank, Parent entrepreneur: No}", size(medium) color(black) nobox) xtitle("", size(medium)) xtitle(, color(black)) legend(ring(0) bplace(swest) order(10 "Top decile" 1 "Bottom decile" 5 "Deciles 2-9") region(style(none)) cols(1) rowg(0.5)) text(91 1.62 "Parental distribution:") xsc(range(0 10)) xlabel(0(1)10) ysc(range(85 100)) ylabel(85(5)100, angle(0)) name(byprntpeno, replace)

* Combine

gr combine byownpeyes byprntpeyes byownpeno byprntpeno, graphr(c(white)) col(2) ysize(3) title("Share of firms not bankrupt (%)", pos(9) orientation(vertical) size(small)) note("Firm age in years", pos(6) size(small)) name(figA11, replace)
gr drop byownpeyes byprntpeyes byownpeno byprntpeno
graph export "$figs\figA11.eps", as(eps) preview(off) replace

/*
Figure A12: Firm-level outcomes by individual income and parental entrepreneurship within the top decile of individual income
*/

use "$output\05_firmperformance\figA12", clear
gen ptile_l=ptile-0.05
gen ptile_r=ptile+0.05
gen ptile_ll=ptile-0.2
gen ptile_rr=ptile+0.2

foreach x in ttl_sales ttl_empl ttl_stfc ttl_va ttl_prod rd_ever {
	rename `x'_peyes peyes_mean_`x'
	rename `x'_peyes_95lo peyes_95lo_`x'
	rename `x'_peyes_95up peyes_95up_`x'
	rename `x'_peno peno_mean_`x'
	rename `x'_peno_95lo peno_95lo_`x'
	rename `x'_peno_95up peno_95up_`x'
}

*********************************

/*
Sales (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_sales ptile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_sales ptile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_sales peyes_95up_ttl_sales ptile_l, col(maroon%25) || rcap peno_95lo_ttl_sales peno_95up_ttl_sales ptile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel A: Log sales}", size(medsmall)) ytitle("") ysc(range(12.5 15.5)) ylabel(12.5(0.5)15.5,angle(0)) xsc(range(91 100)) xlabel(91(1)100) legend(off) name(sales, replace)

*********************************

/*
Number of employees (cumulative full-time equivalent from t to t+10)
*/

twoway scatter peyes_mean_ttl_empl ptile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_empl ptile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_empl peyes_95up_ttl_empl ptile_l, col(maroon%25) || rcap peno_95lo_ttl_empl peno_95up_ttl_empl ptile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel B: Log number of employees}", size(medsmall)) ytitle("") ysc(range(1 3.5)) ylabel(1(0.5)3.5,angle(0)) xsc(range(91 100)) xlabel(91(1)100) legend(off) name(empl, replace)

*********************************

/*
Staff costs (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_stfc ptile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_stfc ptile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_stfc peyes_95up_ttl_stfc ptile_l, col(maroon%25) || rcap peno_95lo_ttl_stfc peno_95up_ttl_stfc ptile_r, col(maroon%25) || , graphr(c(white)) scheme(s2mono) title("{it:Panel C: Log staff costs}", size(medsmall)) ytitle("") ysc(range(8 14)) ylabel(8(1)14,angle(0)) xsc(range(91 100)) xlabel(91(1)100) legend(off) name(stfc, replace)

*********************************

/*
Value added (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_va ptile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_va ptile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_va peyes_95up_ttl_va ptile_l, col(maroon%25) || rcap peno_95lo_ttl_va peno_95up_ttl_va ptile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel D: Log value added}", size(medsmall)) ytitle("") ysc(range(9 15)) ylabel(9(1)15,angle(0)) xsc(range(91 100)) xlabel(91(1)100) legend(off) name(va, replace)

*********************************

/*
Productivity, value-added / employees (cumulative over t and t+10)
*/

twoway scatter peyes_mean_ttl_prod ptile_l, mc(maroon) msymbol(s) || scatter peno_mean_ttl_prod ptile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_ttl_prod peyes_95up_ttl_prod ptile_l, col(maroon%25) || rcap peno_95lo_ttl_prod peno_95up_ttl_prod ptile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) ytitle("") title("{it:Panel E: Log productivity}", size(medsmall)) ysc(range(9 13)) ylabel(9(1)13,angle(0)) xsc(range(91 100)) xlabel(91(1)100) legend(off) name(prod, replace)

*********************************

/*
Share with any R&D over t and t+10
*/

twoway scatter peyes_mean_rd_ever ptile_l, mc(maroon) msymbol(s) || scatter peno_mean_rd_ever ptile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_rd_ever peyes_95up_rd_ever ptile_l, col(maroon%25) || rcap peno_95lo_rd_ever peno_95up_rd_ever ptile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) ytitle("") title("{it:Panel F: Share any R&D}", size(medsmall)) ysc(range(0 0.7)) ylabel(0(0.1)0.7,angle(0)) xsc(range(91 100)) xlabel(91(1)100) legend(order(1 "Parent entrepreneur: Yes" 2 "Parent entrepreneur: No") region(style(none)) cols(1) rowg(0.05) size(small)) name(rd, replace)

*********************************

/*
Combine
*/

gr combine sales empl stfc va prod rd, graphr(c(white)) col(3) ysize(3) title("", size(small) color(black) nobox) note("Individual income percentile rank", pos(6) size(small)) name(figA12, replace)
gr drop sales empl stfc va prod rd
graph export "$figs\figA12.eps", as(eps) preview(off) replace

/*
Figure A13: Firm-level outcomes by individual income and parental entrepreneurship: conditional on survival until t+10
*/

use "$output\05_firmperformance\figA13", clear
drop decile
gen dile_l=_n-0.05
gen dile_r=_n+0.05
gen dile_ll=_n-0.2
gen dile_rr=_n+0.2

foreach x in sales empl stfc va prod rd {
	rename `x'_peyes peyes_mean_`x'
	rename `x'_peyes_95lo peyes_95lo_`x'
	rename `x'_peyes_95up peyes_95up_`x'
	rename `x'_peno peno_mean_`x'
	rename `x'_peno_95lo peno_95lo_`x'
	rename `x'_peno_95up peno_95up_`x'
}

*********************************

/*
Sales (cumulative over t and t+10)
*/

twoway scatter peyes_mean_sales dile_l, mc(maroon) msymbol(s) || scatter peno_mean_sales dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_sales peyes_95up_sales dile_l, col(maroon%25) || rcap peno_95lo_sales peno_95up_sales dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel A: Log sales}", size(medsmall)) ytitle("") ysc(range(14 16)) ylabel(14(0.5)16,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(sales, replace)

*********************************

/*
Number of employees (cumulative full-time equivalent from t to t+10)
*/

twoway scatter peyes_mean_empl dile_l, mc(maroon) msymbol(s) || scatter peno_mean_empl dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_empl peyes_95up_empl dile_l, col(maroon%25) || rcap peno_95lo_empl peno_95up_empl dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel B: Log number of employees}", size(medsmall)) ytitle("") ysc(range(2.5 4)) ylabel(2.5(0.5)4,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(empl, replace)

*********************************

/*
Staff costs (cumulative over t and t+10)
*/

twoway scatter peyes_mean_stfc dile_l, mc(maroon) msymbol(s) || scatter peno_mean_stfc dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_stfc peyes_95up_stfc dile_l, col(maroon%25) || rcap peno_95lo_stfc peno_95up_stfc dile_r, col(maroon%25) || , graphr(c(white)) scheme(s2mono) title("{it:Panel C: Log staff costs}", size(medsmall)) ytitle("") ysc(range(12 14.5)) ylabel(12(0.5)14.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(stfc, replace)

*********************************

/*
Value added (cumulative over t and t+10)
*/

twoway scatter peyes_mean_va dile_l, mc(maroon) msymbol(s) || scatter peno_mean_va dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_va peyes_95up_va dile_l, col(maroon%25) || rcap peno_95lo_va peno_95up_va dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel D: Log value added}", size(medsmall)) ytitle("") ysc(range(12.5 15)) ylabel(12.5(0.5)15,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(va, replace)

*********************************

/*
Productivity, value-added / employees (cumulative over t and t+10)
*/

twoway scatter peyes_mean_prod dile_l, mc(maroon) msymbol(s) || scatter peno_mean_prod dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_prod peyes_95up_prod dile_l, col(maroon%25) || rcap peno_95lo_prod peno_95up_prod dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) ytitle("") title("{it:Panel E: Log productivity}", size(medsmall)) ysc(range(11.5 13.5)) ylabel(11.5(0.5)13.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(prod, replace)

*********************************

/*
Share with any R&D over t and t+10
*/

twoway scatter peyes_mean_rd dile_l, mc(maroon) msymbol(s) || scatter peno_mean_rd dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_rd peyes_95up_rd dile_l, col(maroon%25) || rcap peno_95lo_rd peno_95up_rd dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) ytitle("") title("{it:Panel F: Share any R&D}", size(medsmall)) ysc(range(0.2 0.7)) ylabel(0.2(0.1)0.7,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(order(1 "Parent entrepreneur: Yes" 2 "Parent entrepreneur: No") region(style(none)) cols(1) rowg(0.05) size(small)) name(rd, replace)

*********************************

/*
Combine
*/

gr combine sales empl stfc va prod rd, graphr(c(white)) col(3) ysize(3) title("", size(small) color(black) nobox) note("Individual income decile rank", pos(6) size(small)) name(figA13, replace)
gr drop sales empl stfc va prod rd
graph export "$figs\figA13.eps", as(eps) preview(off) replace

/*
Figure A14: Firm-level outcomes by parental income and parental entrepreneurship: conditional on survival until t+10
*/

use "$output\05_firmperformance\figA14", clear
drop decile
gen dile_l=_n-0.05
gen dile_r=_n+0.05
gen dile_ll=_n-0.2
gen dile_rr=_n+0.2

foreach x in sales empl stfc va prod rd {
	rename `x'_peyes peyes_mean_`x'
	rename `x'_peyes_95lo peyes_95lo_`x'
	rename `x'_peyes_95up peyes_95up_`x'
	rename `x'_peno peno_mean_`x'
	rename `x'_peno_95lo peno_95lo_`x'
	rename `x'_peno_95up peno_95up_`x'
}

*********************************

/*
Sales (cumulative over t and t+10)
*/

twoway scatter peyes_mean_sales dile_l, mc(maroon) msymbol(s) || scatter peno_mean_sales dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_sales peyes_95up_sales dile_l, col(maroon%25) || rcap peno_95lo_sales peno_95up_sales dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel A: Log sales}", size(medsmall)) ytitle("") ysc(range(14 16)) ylabel(14(0.5)16,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(sales, replace)

*********************************

/*
Number of employees (cumulative full-time equivalent from t to t+10)
*/

twoway scatter peyes_mean_empl dile_l, mc(maroon) msymbol(s) || scatter peno_mean_empl dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_empl peyes_95up_empl dile_l, col(maroon%25) || rcap peno_95lo_empl peno_95up_empl dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel B: Log number of employees}", size(medsmall)) ytitle("") ysc(range(2.5 4)) ylabel(2.5(0.5)4,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(empl, replace)

*********************************

/*
Staff costs (cumulative over t and t+10)
*/

twoway scatter peyes_mean_stfc dile_l, mc(maroon) msymbol(s) || scatter peno_mean_stfc dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_stfc peyes_95up_stfc dile_l, col(maroon%25) || rcap peno_95lo_stfc peno_95up_stfc dile_r, col(maroon%25) || , graphr(c(white)) scheme(s2mono) title("{it:Panel C: Log staff costs}", size(medsmall)) ytitle("") ysc(range(12 14.5)) ylabel(12(0.5)14.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(stfc, replace)

*********************************

/*
Value added (cumulative over t and t+10)
*/

twoway scatter peyes_mean_va dile_l, mc(maroon) msymbol(s) || scatter peno_mean_va dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_va peyes_95up_va dile_l, col(maroon%25) || rcap peno_95lo_va peno_95up_va dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) title("{it:Panel D: Log value added}", size(medsmall)) ytitle("") ysc(range(12.5 15)) ylabel(12.5(0.5)15,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(va, replace)

*********************************

/*
Productivity, value-added / employees (cumulative over t and t+10)
*/

twoway scatter peyes_mean_prod dile_l, mc(maroon) msymbol(s) || scatter peno_mean_prod dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_prod peyes_95up_prod dile_l, col(maroon%25) || rcap peno_95lo_prod peno_95up_prod dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) ytitle("") title("{it:Panel E: Log productivity}", size(medsmall)) ysc(range(11.5 13.5)) ylabel(11.5(0.5)13.5,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(off) name(prod, replace)

*********************************

/*
Share with any R&D over t and t+10
*/

twoway scatter peyes_mean_rd dile_l, mc(maroon) msymbol(s) || scatter peno_mean_rd dile_r, mc(maroon) msymbol(sh) || rcap peyes_95lo_rd peyes_95up_rd dile_l, col(maroon%25) || rcap peno_95lo_rd peno_95up_rd dile_r, col(maroon%25)|| , graphr(c(white)) scheme(s2mono) ytitle("") title("{it:Panel F: Share any R&D}", size(medsmall)) ysc(range(0.2 0.7)) ylabel(0.2(0.1)0.7,angle(0)) xsc(range(1 10)) xlabel(1(1)10) legend(order(1 "Parent entrepreneur: Yes" 2 "Parent entrepreneur: No") region(style(none)) cols(1) rowg(0.05) size(small)) name(rd, replace)

*********************************

/*
Combine
*/

gr combine sales empl stfc va prod rd, graphr(c(white)) col(3) ysize(3) title("", size(small) color(black) nobox) note("Parental income decile rank", pos(6) size(small)) name(figA13, replace)
gr drop sales empl stfc va prod rd
graph export "$figs\figA14.eps", as(eps) preview(off) replace